<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .nav {
            color: black;
        }
        
        li {
            color: red;
        }
        
        .nav .A {
            color: green;
        }
    </style>
</head>

<body>
    <ul class="nav">
        <li class="A">li继承自class类</li>
        <li>继承的权重一概是0</li>
        <li>所以li是red</li>
    </ul>


    <ul class="ZZZ">
        <li class="A">li继承自class类</li>
        <li>继承的权重一概是0</li>
        <li>所以li是red</li>
    </ul>
</body>

</html>